﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.WmsManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.WmsManagement.StoreTransferVMs
{
    public partial class StoreTransferTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._StoreTransfer._Sheet")]
        public ExcelPropety Sheet_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.SheetId);
        [Display(Name = "_Model._StoreTransfer._SheetCode")]
        public ExcelPropety SheetCode_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.SheetCode);
        [Display(Name = "_Model._StoreTransfer._MaterialName")]
        public ExcelPropety MaterialName_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.MaterialName);
        [Display(Name = "_Model._StoreTransfer._Material")]
        public ExcelPropety Material_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.MaterialId);
        [Display(Name = "_Model._StoreTransfer._Qty")]
        public ExcelPropety Qty_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.Qty);
        [Display(Name = "_Model._StoreTransfer._TransferDate")]
        public ExcelPropety TransferDate_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.TransferDate, true);
        [Display(Name = "_Model._StoreTransfer._Status")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.Status);
        [Display(Name = "_Model._StoreTransfer._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.CreateTime, true);
        [Display(Name = "_Model._StoreTransfer._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.UpdateTime, true);
        [Display(Name = "_Model._StoreTransfer._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.CreateBy);
        [Display(Name = "_Model._StoreTransfer._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.UpdateBy);
        [Display(Name = "_Model._StoreTransfer._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.IsValid);
        [Display(Name = "_Model._StoreTransfer._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<StoreTransfer>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Sheet_Excel.DataType = ColumnDataType.ComboBox;
            Sheet_Excel.ListItems = DC.Set<StoreTransferSheet>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());
            Material_Excel.DataType = ColumnDataType.ComboBox;
            Material_Excel.ListItems = DC.Set<MaterialDoc>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class StoreTransferImportVM : BaseImportVM<StoreTransferTemplateVM, StoreTransfer>
    {
            //import

    }

}